import "babel-polyfill";
import Vue from 'vue'
import Vuex from 'vuex';
import App from './App'
import router from './router/router.js'
import store from "./store/store.js"

Vue.use(Vuex);

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: {App}
})

window.goBack = (index) => {
  index = index || -1;
  store.dispatch("headerAnimate_action", 1);
  window.history.go(index);
}

window.headerTitleChange = (v) => {
  store.dispatch("headerAnimate_action", 0);
  store.dispatch("showFlag_action", v);
}

window.goName = (name, flag) => {
  flag && headerTitleChange(flag);
  router.push({name})
}

window.goPathWithParams = (path, flag) => {
  flag && headerTitleChange(flag);
  router.push({path})
}
